package org.yang.plugins.resource.exception;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.springframework.http.HttpStatus;
import org.yang.plugins.resource.serializer.Auth2ExceptionSerializer;

/**
 * 访问被拒绝
 * @author: lslands
 * @version: v2.0
 * @create: 2021/6/14 22:31
 **/
@JsonSerialize(using = Auth2ExceptionSerializer.class)
public class ForbiddenException extends Auth2Exception {

    public ForbiddenException(String msg) {
        super(msg);
    }
    public ForbiddenException(String msg, Throwable t) {
        super(msg);
    }

    @Override
    public String getOAuth2ErrorCode() {
        return "access_denied";
    }

    @Override
    public int getHttpErrorCode() {
        return HttpStatus.FORBIDDEN.value();
    }

}
